package it.polimi.digitalstate.dto;




import java.sql.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;

public class JoinrequestDTO implements IDataTransferObject{
	private Integer id;
	private CitizenDTO citizen;
	private PartyDTO party;
	private String cv;
	@NotEmpty(message="You cannot leave the letter empty")
	private String letter;
	private Date request_date;
	
	public JoinrequestDTO(CitizenDTO citizen, PartyDTO party, String cv,String letter){
		this.citizen = citizen;
		this.party=party;
		this.cv=cv;
		this.letter=letter;
	}
	public JoinrequestDTO(int id,CitizenDTO citizen, PartyDTO party, String cv,String letter, Date request_date){
		this(citizen, party, cv, letter);
		this.id=id;
		this.request_date=request_date;
	}
	public JoinrequestDTO() {
		// TODO Auto-generated constructor stub
	}
	public CitizenDTO getCitizen() {
		return citizen;
	}
	public void setCitizen(CitizenDTO citizen) {
		this.citizen = citizen;
	}
	public PartyDTO getParty() {
		return party;
	}
	public void setParty(PartyDTO party) {
		this.party = party;
	}
	public String getCv() {
		return cv;
	}
	public void setCv(String cv) {
		this.cv = cv;
	}
	public String getLetter() {
		return letter;
	}
	public void setLetter(String letter) {
		this.letter = letter;
	}
	public Date getRequest_date() {
		return request_date;
	}
	public void setRequest_date(Date request_date) {
		this.request_date = request_date;
	}
	@Override
	public int getID() {
		if(id==null){
			//TODO throw exception
		}
		return id.intValue();
	}
	
}
